1 # A rocket is started from the surface of the earth. Calculating the height as function of its mass and fuel consumption.
2 # Approximation of gravity of earth by g
4 # r'' = alpha / (m0 - alpha*t) * v0 - g
5 # alpha: fuel consumption, e.g. 2000t in 2,5 min = 13,333*10^3 kg/s
6 # m0: initial mass of rocket, e.g. Saturn V: 2900 t = 2,9*10^6 kg
7 # v0: the velocity of the exhaust of the rocket: 3,180*10^3 m/s
8 # g: acceleration of earth = 9,81 m/s^2
10 include CompoundFunctions.LACE # include idivide
12 coefficient.1 -> alpha1
13 coefficient.2(+1) -> alpha2 # == alpha1
14 coefficient.3(-1) -> -m0
16 coefficient.5(+1) -> g
21 cmultiply (alpha1, t) -> alpha*t
22 isum (-m0, alpha*t) -> m0-alpha*t
23 idivide (alpha2, m0-alpha*t) -> -alpha/(m0-alpha*t)
24 cmultiply (-alpha/(m0-alpha*t), v0) -> -alpha/(m0-alpha*t)*v0
25 isum(-alpha/(m0-alpha*t)*v0, g) -> alpha/(m0-alpha*t)*v0-g
27 iintegrate (alpha/(m0-alpha*t)*v0-g) -> -v